<#include "/layout/layout.ftl">
<#import "/layout/macro.ftl" as macro>
<#assign css>
</#assign>
<#assign js>
<script>

    $("#close").click(function(){
        closelayer();
    });
    $(".btn-submit").click(function () {
        $.ajax({
            type: "POST",
            dataType: "json",
            url: "${ctx!}/user/updatePwd",
            data: $(".form-edit").serialize(),
            success: function (msg) {
                layer.msg(msg.message, {time: 2000}, function () {
                    if (msg.code == 0) {
                        //window.location.href = "${ctx!}/logout";
                        //alert($(window.parent.document).find("#signout"));
                        $(window.parent.document).find("#signout")[0].click();;
                    } else {
                        location.reload();
                    }
                });
            }
        });
    });
</script>
</#assign>

<@layout title="修改密码" active="user">
<!-- Main content -->
<section class="content">

                <form class="form-horizontal form-edit" method="post" action="${ctx!}/user/updatePwd">
                    <div class="box-body">
                        <div class="form-group">
                            <label for="oldPassword" class="col-sm-3 control-label">原始密码：</label>
                            <div class="col-sm-8">
                                <input id="oldPassword" name="oldPassword" class="form-control" type="password">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="password1" class="col-sm-3 control-label">新 密 码：</label>
                            <div class="col-sm-8">
                                <input id="password1" name="password1" class="form-control" type="password">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="password2" class="col-sm-3 control-label">重复密码：</label>
                            <div class="col-sm-8">
                                <input id="password2" name="password2" class="form-control" type="password">
                            </div>
                        </div>
                    </div>
                    <div class="box-footer">
                        <button type="button" class="btn btn-default" id="close">关闭</button>
                        <button type="button" class="btn btn-info pull-right btn-submit">提交</button>
                    </div>
                </form>

</section>
<!-- /.content -->
</@layout>